package examination.Grandsoft_09_15;

import java.util.Scanner;

public class Question1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();
        for (int i = 0; i < n; i++) {
            String str = in.nextLine();
            int win = 1;
            while (true) {
                int j = 0;
                String prev = str;
                for (; j < str.length() - 1; j++) {
                    if (str.charAt(j) == str.charAt(j + 1)) {
                        String tmp = str.substring(0, j);
                        if (j + 2 < str.length()) {
                            tmp += str.substring(j + 2);
                        }
                        str = tmp;
                        win = -win;
                        break;
                    }
                }
                if (j == prev.length() - 1 || str.length() == 0) {
                    if (win == 1) {
                        System.out.println("No");
                    } else {
                        System.out.println("Yes");
                    }
                    break;
                }
            }
        }
    }
}
